﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Text;
using CoreEx.ServiceModel.Implementation;
using LinFu.IoC.Configuration;

namespace CoreEx.ServiceModel.Tests
{
    [Implements(typeof(DataContractSerializerOperationBehavior))]
    public class NetDataContractSerializerServiceBehavior : DataContractSerializerOperationBehavior
    {
        public NetDataContractSerializerServiceBehavior(OperationDescription operation) : base(operation) { }


        public NetDataContractSerializerServiceBehavior(OperationDescription operation, DataContractFormatAttribute dataContractFormatAttribute) : base(operation, dataContractFormatAttribute)
        {
        }

        public override XmlObjectSerializer CreateSerializer(Type type, string name, string ns, IList<Type> knownTypes)
        {
            return new XmlBinarySerializer();
        }

        public override XmlObjectSerializer CreateSerializer(Type type, System.Xml.XmlDictionaryString name, System.Xml.XmlDictionaryString ns, IList<Type> knownTypes)
        {
            return new XmlBinarySerializer();
        }
    }

}
